<template>
	<view class="zhengti">
		<u-navbar is-back="false" back-icon-name="arrow-left" back-icon-size="35">
			<view class="u-slot-left" style="display: flex;">
				<img src="../../static/img/five.png" class="img2">
				<img src="../../static/img/next.png" class="img1">
			</view>
			
		</u-navbar>
		<view class="content">
			<u-button type="primary" class="custom-style">丁香医生审稿专业委员会通过</u-button>
			<p class="text">杨梅、樱桃用盐水泡出虫！怎样买到放心的？</p>
			<view style="display: flex;width: 100%;height: 100%;">
				<img src="https://img.xiaopiu.com/userImages/img415969455ab0.jpg" style="width: 30px;height: 30px;left: 12px;top: 185px;border-radius: 15px;margin-left: 20px;margin-top: 20px;">
				<view style="padding-top: 18px;padding-left: 20px;">
					<p style="width: 167px;height: 16px;left: 61px;top: 185px;color: rgba(0, 0, 0, 1);font-size: 10px;line-height: 150%;text-align: left;font-weight: bold;">兰晓芳</p>
					<p style="width: 188px;height: 16px;left: 61px;top: 201px;color: rgba(128, 128, 128, 1);font-size: 8px;line-height: 150%;text-align: left;">中国农业大学 食品加工与安全硕士</p>
				</view>
			</view>
			<view class="tupian">
				<img src="https://img.xiaopiu.com/userImages/img197916353237230.jpeg" style="width: 375px;height: 172px;left: 1px;">
				<p class="text2">在杨梅快要成熟的时候，果蝇会在里面产卵，这些卵孵化后就变成了我们用盐水泡出来的小白虫。
				   虽然听起来有点不舒服，但其实这并不影响杨梅的食用价值，也并不是杨梅质量不好的表现。
				   果蝇跟苍蝇不同，它们从小吃果肉长大，干净无毒、不致病，也不会寄生在人体内。进入胃里后，它们无法在胃酸中存活，最终会作为蛋白质和食物一起被消化掉。
				 </p>
			</view>
			<view class="banquan">
				<p style="color: rgba(80, 80, 80, 1);">丁香园版权所有，未经许可不得转载。</p>
				<p style="color: rgba(128, 128, 128, 1);">图片来源：123rf.com.cn正版图片库</p>
				<p style="color: rgba(80, 80, 80, 1);">责任编辑：feidi</p>
			</view>
			<view class="mingpian">
				<img src="https://img.xiaopiu.com/userImages/img19441635306f150.jpeg" style="width: 67px;height: 67px;border-radius: 34px;">
				<view>
					<p>丁香医生审稿专业委员会</p>
					<p>2018年 05 月同行评议通过</p>
				</view>
				<u-icon name="arrow-right" color="#999999" size="28" style="margin-left: 30px;"></u-icon>
			</view>
			<view class="tubiao">
				<p class="bangzhu">有帮助(24)</p>
				<img src="../../static/img/chat.png" style="margin-left: 60px;">
				<img src="../../static/img/donut_large_24px.png">
				<img src="../../static/img/ic note add 24px.png">
			</view>
			<view>
				<p style="height: 30px;line-height: 40px;text-align:left;padding-left: 20px;">精彩评论(12)</p>
				<view class="comment" v-for="(res, index) in commentList" :key="res.id">
					<view class="left"><image :src="res.url" mode="aspectFill" style="width: 32px;height: 32px;"></image></view>
					<view class="right">
						<view class="top">
							<view class="name">{{ res.name }}</view>
							<view class="like" :class="{ highlight: res.isLike }">
								<view class="num">{{ res.likeNum }}</view>
								<u-icon v-if="!res.isLike" name="thumb-up" :size="30" color="#9a9a9a" @click="getLike(index)"></u-icon>
								<u-icon v-if="res.isLike" name="thumb-up-fill" :size="30" @click="getLike(index)"></u-icon>
							</view>
						</view>
						<view class="content">{{ res.contentText }}</view>
						
						<view class="bottom">
							{{ res.date }}
							<view class="reply">回复</view>
						</view>
					</view>
				</view>
				<p style="height: 30px;line-height: 40px;">全部精彩评论 ></p>
			</view>
			<u-card :title="title" >
					<view class="" slot="body">
						<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
							<view class="u-body-item-title u-line-2">泡出白虫？吃出砒霜？吃杨梅前一定要知道这些真相</view>
							
						</view>
						<view class="u-body-item u-flex u-border-bottom u-row-between u-p-b-0">
							<view class="u-body-item-title u-line-2">栏目.来问（十一）</view>
							
						</view>
						<view class="u-body-item u-flex u-row-between u-p-b-0">
							<view class="u-body-item-title u-line-2">吃水果也会「被酒驾」关于酒驾食物的真相盘点</view>
							
						</view>
					</view>
					<view class="" slot="foot"><u-icon name="chat-fill" size="34" color="" label="更多相关文章   >"></u-icon></view>
			</u-card>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				commentList: [],
				title: '推荐文章'
			}
		},
		onLoad() {
             this.getComment();
		},
		methods: {
			toAllReply() {
				uni.navigateTo({
					url: '/pages/template/comment/reply'
				});
			},
			// 点赞
			getLike(index) {
				this.commentList[index].isLike = !this.commentList[index].isLike;
				if (this.commentList[index].isLike == true) {
					this.commentList[index].likeNum++;
				} else {
					this.commentList[index].likeNum--;
				}
			},
			// 评论列表
			getComment() {
				this.commentList = [
					{
						id: 1,
						name: 'dizuox-189k',
						date: '12-25 18:58',
						contentText: '吃杨梅就像吃野生菌一样，要吃有一点微酸的才好吃。',
						url: 'https://img.xiaopiu.com/userImages/img415969455ab0.jpg',
						likeNum: 33,
						isLike: false
						
					},
					{
						id: 2,
						name: 'dizuox-189k',
						date: '01-25 13:58',
						contentText: '不过杨梅还是要少吃，吃的太多的话牙齿会倒掉，甚至连豆腐都咬不动。',
						likeNum: 11,
						isLike: false,
						url: 'https://img.xiaopiu.com/userImages/img415969455ab0.jpg',
					},
					{
						id: 3,
						name: 'dizuox-189k',
						date: '03-25 13:58',
						contentText: '不过杨梅还是要少吃，吃的太多的话牙齿会倒掉，甚至连豆腐都咬不动。',
						likeNum: 21,
						isLike: false,
						allReply: 2,
						url: 'https://img.xiaopiu.com/userImages/img415969455ab0.jpg'
						
					}
				];
			},
			goto(url){
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		text-align: center;
		height: 100%;
		margin-top: 200upx;
		background-color:#FFFFFF;
	}
	.img1{
		width: 26px;
		height: 26px;
		
	}
	.img2{
		width: 26px;
		height: 26px;
		margin-left: 270px;
		padding-right: 10px;
	}
	.custom-style{
		width: 226px;
		height: 21px;
		background-color: #E5E5E5;
		color: #505050;
		border-radius: 16px;
		margin-top: -90px;
		margin-left: 10px;
	}
	.text{
		font-size: 22px;
		font-weight: 300;
		padding-left: 10px;
		padding-right: 30px;
		padding-top: 5px;
		text-align: justify;
	}
	.text2{
		width: 344px;
		height: 246px;
		left: 16px;
		top: 112px;
		letter-spacing: 1px;
		color: rgba(80, 80, 80, 1);
		font-size: 14px;
		line-height: 200%;
		text-align: justify;
		font-weight: bold;
		padding-left: 15px;
		padding-right: 30px;
	}
	.banquan p{
		text-align: justify;
		padding-left: 20px;
	}
	.mingpian{
		    display: flex;
		    width: 326px;
			height: 83px;
			left: 24px;
			top: 215px;
			color: rgba(80, 80, 80, 1);
			background-color: rgba(229, 229, 229, 1);
			font-size: 14px;
			line-height: 150%;
			text-align: center;
			margin-top: 20px;
			margin-left: 20px;
			padding-left: 20px;
			padding-top: 10px;
	}
	.mingpian p{
		padding-top: 5px;
	}
	
	.zhengti{
		height: 1200px;
		background-color:#FFFFFF;
	}
	.tupian{
		margin-top: -1120px;
	}
	.bangzhu{
		        width: 200px;
		        height: 33px;
		    	margin-top: 20px;
				margin-left: 20px;
		    	color: rgba(255, 255, 255, 1);
		    	background-color: rgba(0, 186, 173, 1);
		    	font-size: 14px;
		    	line-height: 200%;
		    	text-align: center;
				
	}
	.tubiao{
		display: flex;
	}
	.tubiao img{
		width: 32px;
		height: 32px;
		margin-top: 20px;
		padding-left: 10px;
	}
	.comment{
		display: flex;
	    border-bottom:2px solid #F4F4F4;
		padding: 30rpx;
		.left {
			image {
				width: 64rpx;
				height: 64rpx;
				border-radius: 50%;
				background-color: #f2f2f2;
			}
		}
		.right {
			flex: 1;
			padding-left: 20rpx;
			font-size: 30rpx;
			
			
			.top {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 10rpx;
				
				.name {
					color: #5677fc;
				}
				.like {
					display: flex;
					align-items: center;
					color: #9a9a9a;
					font-size: 26rpx;
					.num {
						margin-right: 4rpx;
						color: #9a9a9a;
					}
				}
				.highlight {
					color: #5677fc;
					.num {
						color: #5677fc;
					}
				}
			}
			.content {
				margin-bottom: 10rpx;
				height: 30px;
				margin-top: 10px;
				text-align: justify;
			}
			.reply-box {
				background-color: rgb(242, 242, 242);
				border-radius: 12rpx;
				.item {
					padding: 20rpx;
					border-bottom: solid 2rpx $u-border-color;
					.username {
						font-size: 24rpx;
						color: #999999;
					}
				}
				.all-reply {
					padding: 20rpx;
					display: flex;
					color: #5677fc;
					align-items: center;
					.more {
						margin-left: 6rpx;
					}
				}
			}
			.bottom {
				margin-top: 20rpx;
				display: flex;
				font-size: 24rpx;
				color: #9a9a9a;
				.reply {
					color: #5677fc;
					margin-left: 10rpx;
				}
			}
		}
	}
	.u-card-wrap { 
			background-color: $u-bg-color;
			padding: 1px;
		}
		
		.u-body-item {
			font-size: 28rpx;
			font-weight: 800;
			color: #333;
			padding: 20rpx 10rpx;
			text-align: justify;
		}
			
		.u-body-item image {
			width: 120rpx;
			flex: 0 0 120rpx;
			height: 120rpx;
			border-radius: 8rpx;
			margin-left: 12rpx;
		}
</style>